package com.bc.trade.channel.wmyl;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import com.jfinal.kit.StrKit;

public class BankCode {
	public static Map<String, String> bankEnShortMap = new HashMap<String,String>();
	static {
		bankEnShortMap.put("中国工商银行", "ICBC");
		bankEnShortMap.put("中国农业银行", "ABC");
		bankEnShortMap.put("中国银行", "BOC");
		bankEnShortMap.put("中国建设银行", "CCB");
		bankEnShortMap.put("交通银行", "BOCOM");
		bankEnShortMap.put("中信银行", "CITIC");
		bankEnShortMap.put("中国光大银行", "CEB");
		bankEnShortMap.put("华夏银行", "HXB");
		bankEnShortMap.put("中国民生银行", "CMBC");
		bankEnShortMap.put("广发银行", "CGB");
		bankEnShortMap.put("平安银行", "PAB");
		bankEnShortMap.put("招商银行", "CMB");
		bankEnShortMap.put("兴业银行", "CIB");
		bankEnShortMap.put("浦发银行", "SPDB");
		bankEnShortMap.put("恒丰银行", "EBCL");
		bankEnShortMap.put("中国邮政储蓄银行", "PSBC");
		bankEnShortMap.put("广东华兴银行股份有限公司", "GHB");
		bankEnShortMap.put("东莞银行股份有限公司", "DGB");
	}
	
	public static String getBankCode(String bankName) {
		String bankCode = bankEnShortMap.get(bankName);
		if (StrKit.isBlank(bankCode)) {
			for (Entry<String, String> entry : bankEnShortMap.entrySet()) {
				String key = entry.getKey();
				if(key.contains(bankName)) {
					bankCode = entry.getValue();
				}
			}
		}
		return bankCode;
	}
}
